package day06;

import java.lang.reflect.Array;
import java.util.Arrays;

public class TextClass {
    public static void main(String[] args) {
        int[] a = new int[5];
        for (int i = 0; i < a.length; i++) {
            a[i] = (int) (Math.random() * 100);
            System.out.print(a[i] + "\t");
        }
        System.out.println();
        int max = a[0];
        for (int i = 1; i < a.length; i++) {
            if (max < a[i]) {
                max = a[i];
            }
        }
        a = Arrays.copyOf(a, a.length + 1);
        a[a.length - 1] = max;
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i] + "\t");
        }
        sayHi(5);
        sayHello("王帅",78);
        System.out.println("输出一个随机0-99之间的数"+"\t"+testArray(3));
        int aa=a1(12,45);
        System.out.println(aa);
    }
    public static void sayHi(int t){
        System.out.println("你的年龄为："+t);
    }
    public static void sayHello(String i,int j){
        System.out.println("姓名为："+i+"age="+j);
    }
    public static int a1(int a,int b) {
        int sum = a + b;
        return sum;
    }

    public static int testArray(int number){
        int cc=(int)(Math.random()*100);
        return cc;
    }


    /*  int[]a=new int[5];
        for(int i=0;i< a.length;i++){
            a[i]=(int)(Math.random()*100);
            System.out.print(a[i]+"\t");
        }
        System.out.println();
        int max=a[0];
        for(int i=0;i< a.length;i++){
            if (max<a[i]) {
                max=a[i];
            }
        }
        a= Arrays.copyOf(a,a.length+1);
        a[a.length-1]=max;
       for(int i=0;i< a.length;i++){
           System.out.print(a[i]+"\t");
       }
        say();
        SayHi("王小明");
        SayHello("叶问",20);
        System.out.println("输出一个随机0-99之间的数"+"\t"+arr(6));
        System.out.println(a(8,8));
     */

    public static void say(){
        System.out.println("你好，我叫姜志可");
    }
    public static void  SayHi(String name){
        System.out.println("您好，你的名字是："+name);
    }
    public static void SayHello(String name,int age){
        System.out.println("您的名字是："+"年纪为："+age);
    }
    public static int arr(int number){
        int cc=(int)(Math.random()*100);
        return cc;
    }
    public static int a(int a1,int a2) {
        int sum = a1 + a2;
        return sum;
    }
}





